﻿using Aker.DevTeam;
using DevExpress.XtraEditors;
using System;

namespace Aker.Uretim
{
    public partial class Iade : XForm
    {
        public decimal Qty;
        public decimal Iskonto;
        int PorderLinesId;
        public Iade(int porderLinesId)
        {
            InitializeComponent();
            this.PorderLinesId = porderLinesId;
            this.Text += " " + "(POrderLinesId:"+PorderLinesId+")";
        }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            Qty = txtQty.Text.ToDecimalNN();
            Iskonto = txtIskontoTutari.Text.ToDecimalNN();
            if (Qty == 0)
            {
                XtraMessageBox.Show("Miktar boş bırakılamaz!", "Uyarı", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            Data.DM.ExecuteNonQuery("InsIade", PorderLinesId, Qty,Iskonto, cmbTip.SelectedIndex + 1, txtAciklama.Text, AppSession.UserInfo.UserId);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

    }
}
